{extend name="../../base/view/layout" /}
{block name="my_body"}
<div class="widgetbox box-inverse">
    <div class="widgetcontent wc1">

        <form id="form1" class="stdform" enctype="multipart/form-data" method="post" action="<?php echo url('pic/Picture/add');?>">

            <div class="tabbable">
                <ul class="nav nav-tabs buttons-icons">
                    <li><a data-toggle="tab" href="#shop_info">基础信息</a></li>
                    <li><a data-toggle="tab" href="#shop_photos">添加照片</a></li>
                </ul>
                <div class="tab-content">

                    <div id="shop_info" class="tab-pane active">
                        <div class="par control-group">
                            <label class="control-label" for="album_id">相册名称</label>
                            <span class="field">
                            <select name="album_id" class="uniformselect" id="album_id">
                            	<option value="0">--选择相册--</option>
                                <?php foreach ($typeData as $v):?>
                            	<option value="<?php echo $v['id'];?>" <?php if($album_id == $v['id']) echo 'selected';?>><?php echo $v['name'];?></option>
                                <?php endforeach;?>

                            </select>
                            </span>
                        </div>
                    </div>

                    <!--相册-->
                    <div id="shop_photos" class="tab-pane">

                        <div class="control-group par">
                            <!--<label class="control-label" for="logo">商品相册</label>-->
                            <div class="controls">
                                <ul>
                                    <li class="li-deltype"><input type="file" name="pic[]"  />&ensp;&ensp;&ensp;&ensp;<input type="button"  value='增加' class="btn btn-primary btn-rounded addpic" /></li>
                                </ul>
                            </div>
                        </div>


                    </div>

                </div><!--tabcontent-->
            </div><!--tabbable-->


            <p class="stdformbutton">
                <input type="submit" class="btn btn-primary" />
            </p>
        </form>
    </div><!--widgetcontent-->
</div><!--widget-->
{/block}

{block name="my_js"}
<script>
    var $ = jQuery.noConflict();

    //增加图片
    $('.addpic').click(function(){
        var li=$(this).parent();
        if($(this).attr('value')=='增加'){
            var newLi=li.clone(true);
            newLi.find("input[type='button']").attr('value','删除').css('background-color','#ffae00');
            li.after(newLi);
        }else{
            li.remove();
        }
    })

</script>
{/block}